The programming is meant to make A matrix for serial music using the 12 tone technique. I can't visualise whats happening in specfically this bit of code
Code:
/* create inversion in column 1 */
    for(m = 1; m < 12; m++)
        series[m][0] = mod12(series[m-1][0] + series[0][m-1]
                             - series[0][m]);
I'm expecting something like this
for (m = 1; m < 12; m ++)
series[m][0] = [0][-1]
series[m][0] = [1][-1]
series[m][0] = [2][-1]

and so on...

is it saying take the result of mod12(series[x][x]) and put it into series[x][x]?

is series[x][x] a single value or two?


Code:
/* The first row of the matrix will receive the original twelve notes, from left to right.
 The inversion of the series will fill the first column of the matrix, from top to bottom.
 To complete the matrix, the other rows will receive transposed versions of the original
 series, each one starting with the note in the first column. */




#include <stdio.h>
#include <stdlib.h>


int mod12(int note) {
    while(note >= 12) note -= 12;
    while(note < 0) note += 12;
    return note;
}


int main(int argc, char** argv)
{
    int series[12][12], offset;
    int n, m, i;
    char* table[12]={"C","Db","D","Eb",
                    "E","F","Gb","G",
                    "Ab","A","Bb","B"};
    if(argc != 13) {
        printf("usage: %s note1 note2 ... note12\n", argv[0]);
        return -1;
    }
    /* loop until all available notes are entered*/
    for(n = 0; n < 12; n++)
        series[0][n] = mod12(atoi(argv[n+1]));
    
    /* create inversion in column 1 */
    for(m = 1; m < 12; m++)
        series[m][0] = mod12(series[m-1][0] + series[0][m-1]
                             - series[0][m]);
    
    /*create all transposition */
    for(m = 1; m < 12; m++)
        for(n = 1; m < 12; m++)
            series[m][n] = mod12(series[0][n] + series[m][0]
                                 - series[0][0]);
    
    for(m = 0; m < 12; m++){
        /* print the pitch classes, row by row using the
             translation table */
        for(n = 0; n < 12; n++) printf(" %s ", table[series[m][n]]);
        printf("\n");
    }


    return 0;
}